package com.gz.spring.jdbcTemplate.dao;

import com.gz.spring.bean.Monster;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;

@Repository
public class MonsterDao {

    @Resource
    private JdbcTemplate jdbcTemplate;

    public void save(Monster monster) {
        String sql = "insert into monster values (?,?,?)";
        int update = jdbcTemplate.update(sql, monster.getMonsterId(),
                monster.getName(), monster.getSkill());
        System.out.println("update= "+update);
    }
}
